<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\datecontrol\DateControl;
/* @var $this yii\web\View */
/* @var $model app\models\Patent */
/* @var $form yii\widgets\ActiveForm */
?>
<?php

?>
<div class="patent-form">
    
     <h4><?= Html::encode($model->isNewRecord ? '新建专利>>' : '更新专利>>') ?></h4>
    
<div class="panel panel-default">
        <!--<div class="panel-heading text-center" style="background: #003eff;color:white">patent</div>-->
        <div class="panel-body">
    <?php $form = ActiveForm::begin([
                'options' => ['class' => 'form-horizontal form-group'],
                'fieldConfig' => [
                    'template' => "{label}<div class=\"col-lg-8\">{input}</div>",
                    'labelOptions' => ['class' => 'col-lg-4', 'style' => 'margin-right:-30px'],
                ]
    ]); ?>

     <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'patentname')->textInput(['maxlength' => true]) ?>
    </div>
         <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'patentno')->textInput(['maxlength' => true]) ?>
    </div>
      <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'patenttype')->textInput(['maxlength' => true]) ?>
    </div>
    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
         <?= $form->field($model, 'patentdate')->widget(DateControl::className(), [
                //日期组件的类型，是time 还是 date 或者 datetime(前提是要下载好相应的组件)
                'type' => DateControl::FORMAT_DATE,
                'ajaxConversion' => false,
                'options' => [
                    'pluginOptions' => [
                        'autoclose' => true,
                        //设置开始日期
                        //'startDate' => date(date('Y-m-d')),
                        //设置结束日期
                       // 'endDate' => '2025-09-29',
                        //当前日期高亮显示
                        'todayHighlight' => true
                    ],
                      'options' => ['placeholder' => isset($model->patentdate) ? $model->patentdate : '请选择时间'],
                ]
                    ]
            )
            ?>
    </div>
        <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'author')->textInput(['maxlength' => true]) ?>
    </div>
       <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'sort')->textInput() ?>
    </div>
        <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'regno')->textInput(['maxlength' => true]) ?>
    </div>
       <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'checkunit')->textInput(['maxlength' => true]) ?>
    </div>
         <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'mark')->textInput(['maxlength' => true]) ?>
    </div>
     
        <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'isfinish')->dropDownList(['1'=>'是','0'=>'否'],['prompt'=>'请选择']) ?>
    </div>
            
            
         <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">
                <div class="form-group">
                    <?= Html::submitButton('保存', ['class' => 'btn btn-success col-lg-offset-5 col-md-offset-5']) ?>
                    <?= Html::a('返回', ['index'], ['class' => 'btn btn-primary']) ?>
                </div>
            </div>

    <?php ActiveForm::end(); ?>
      </div>
    </div>

</div>
